<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->

<head>
<meta charset="utf-8">
<title>SMM撮合系统-客户管理</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1" name="viewport">
<meta content="" name="description">
<meta content="" name="author">
<link href="${request.getContextPath()}/Public/assets/admin/css/css.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/font-awesome/css/font-awesome.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/simple-line-icons/simple-line-icons.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/css/bootstrap.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/uniform/css/uniform.default.css"
	rel="stylesheet" type="text/css">
<link rel="${request.getContextPath()}/Public/stylesheet"
	type="text/css"
	href="assets/global/plugins/jquery-notific8/jquery.notific8.min.css" />
<link
	href="${request.getContextPath()}/Public/assets/global/css/components-rounded.css"
	id="style_components" rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/plugins.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/layout.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/themes/default.css"
	rel="stylesheet" type="text/css" id="style_color">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/custom.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/global/css/kkpager.css"
	rel="stylesheet" type="text/css">
<link
	href="${request.getContextPath()}/Public/assets/admin/css/common.css"
	rel="stylesheet" type="text/css">
<link rel="shortcut icon"
	href="${request.getContextPath()}/Public/assets/global/plugins/datatables/media/images/favicon.ico">
<link href="${request.getContextPath()}/Public/css/customerDetail.css"
	rel="stylesheet" type="text/css">
<style type="text/css">
a:hover {
	text-decoration: none;
	color: red
}

a:visited {
	text-decoration: none;
}

a:link {
	text-decoration: none;
}

a:active {
	text-decoration: none;
}
</style>
</head>

<body class="page-header-top-fixed">
	<!-- 头部开始 -->
	<div class="page-header">
		<!--头部开始-->
		<#include "/include/top.html" />
		<!-- 头部信息结束 -->
		<!-- 头部菜单开始 -->
		<#include "/include/top_menu.html" />
		<!-- 头部菜单结束 -->
	</div>
	<!-- 头部结束 -->
	<div class="page-container">
		<!-- 内容开始 -->
		<div class="page-content">
			<div class="container-fluid">
				<!-- 当前位置提示开始 -->
				<ul class="page-breadcrumb breadcrumb">
					<li><a href="#">首页</a><i class="fa fa-circle"></i></li>
					<li class="active">客户管理<i class="fa fa-circle"></i>
					</li>
					<li class="active">线索池</li>
				</ul>
				<!-- 当前位置提示结束 -->
				<div class="row margin-top-10">
					<div class="col-md-12">
						<div class="portlet light bordered">
							<div class="portlet-body" style="height: 13px;padding-top: 2px">
								<div style="float: left;">
									视图： <a href="#" onclick="gettrollList('0');">全部 </a>| <a
										href="#" onclick="gettrollList('1');">网站注册</a> | <a href="#"
										onclick="gettrollList('2');">我创建的</a>| <a href="#"
										onclick="gettrollList(3);">部门创建的</a>| <a href="#"
										onclick="gettrollList(9);">已转换线索</a>
								</div>
								<div style="float: right;">
									<i class="fa fa-clock-o"></i> <a href="#"
										onclick="gettrollList('4');">本月需联系</a> | <a href="#"
										onclick="gettrollList('5');">从未联系 </a>| <a href="#"
										onclick="gettrollList('6');">最近创建</a> | <a href="#"
										onclick="gettrollList('7');">最近修改</a> &nbsp; &nbsp;<i
										class="fa fa-trash-o"></i> <a href="#"
										onclick="gettrollList('8');">回收站</a>
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="portlet light bordered">
							<div class="portlet-body">
								<div class="row">
									<#if typeVal?? && typeVal!=8>
									<div style="float: left;width: 100px; margin-left: 15px;">
										<div class="btn-group pull-left">
											<button class="btn green dropdown-toggle"
												data-toggle="dropdown" aria-expanded="true"
												onclick="CommonUtils.doExecute('${request.getContextPath()}/TrailPoolPojo/updateList.do');">
												批量删除
												<!-- <i class="fa fa-angle-down"></i>-->
											</button>
										</div>
									</div>
									</#if> <input type="hidden" value="${typeVal}" id="typeVal"
										name="typeVal">
									<div style="float: left;width: 62%">
										<div style="float: left;width: 180px;">
											<select class="form-control" name="tpoolOne" id="tpoolOne"
												onchange="selectColumn()">
												<option value="0"<#if tpoolOne?? &&
													tpoolOne="0">selected<#else></#if> >--选择筛选条件--</option>
												<option value="1"<#if tpoolOne?? &&
													tpoolOne="1">selected<#else></#if> >公司名</option>
												<option value="2"<#if tpoolOne?? &&
													tpoolOne="2">selected<#else></#if> >来源</option>
												<option value="3"<#if tpoolOne?? &&
													tpoolOne="3">selected<#else></#if> >联系人</option>
												<option value="4"<#if tpoolOne?? &&
													tpoolOne="4">selected<#else></#if> >职位</option>
												<option value="5"<#if tpoolOne?? &&
													tpoolOne="5">selected<#else></#if> >手机</option>
												<option value="6"<#if tpoolOne?? &&
													tpoolOne="6">selected<#else></#if> >QQ</option>
												<option value="7"<#if tpoolOne?? &&
													tpoolOne="7">selected<#else></#if> >邮箱</option>
												<option value="8"<#if tpoolOne?? &&
													tpoolOne="8">selected<#else></#if> >地址</option>
												<option value="9"<#if tpoolOne?? &&
													tpoolOne="9">selected<#else></#if> >下次联系时间</option>
												<option value="10"<#if tpoolOne?? &&
													tpoolOne="10">selected<#else></#if> >下次联系内容</option>
												<option value="11"<#if tpoolOne?? &&
													tpoolOne="11">selected<#else></#if> >负责人</option>
												<option value="12"<#if tpoolOne?? &&
													tpoolOne="12">selected<#else></#if> >创建时间</option>
												<option value="13"<#if tpoolOne?? &&
													tpoolOne="13">selected<#else></#if> >修改时间</option>
											</select>
										</div>
										<div style="float: left;width: 180px; margin-left:15px;">
											<select class="form-control" name="tpoolTwo" id="tpoolTwo">
												<option value="0"<#if tpoolTwo?? &&
													tpoolTwo="0">selected<#else></#if> >--选择筛选条件--</option>
												<option value="1"<#if tpoolTwo?? &&
													tpoolTwo="1">selected<#else></#if> >包含</option>
												<option value="2"<#if tpoolTwo?? &&
													tpoolTwo="2">selected<#else></#if> >不包含</option>
												<option value="3"<#if tpoolTwo?? &&
													tpoolTwo="3">selected<#else></#if> >等于</option>
												<option value="4"<#if tpoolTwo?? &&
													tpoolTwo="4">selected<#else></#if> >不等于</option>
												<option value="5"<#if tpoolTwo?? &&
													tpoolTwo="5">selected<#else></#if> >开始字符</option>
												<option value="6"<#if tpoolTwo?? &&
													tpoolTwo="6">selected<#else></#if> >结束字符</option>
												<option value="7"<#if tpoolTwo?? &&
													tpoolTwo="7">selected<#else></#if> >为空</option>
												<option value="8"<#if tpoolTwo?? &&
													tpoolTwo="8">selected<#else></#if> >不为空</option>
											</select>
										</div>
										<div class="col-md-3">
											<input type="text" class="form-control" name="tpoolThree"
												id="tpoolThree"<#if
											tpoolTwo??>value=${tpoolThree}<#else></#if> >
										</div>
										<div class="col-md-3">
											<button class="btn green" type="button"
												onclick="gettrollList();">
												<i class="fa fa-search"></i> 搜索
											</button>
										</div>
									</div>
									<!-- 						</form>	 -->
									<div
										style="float: right;width: 18%;text-align: right; padding-right: 18px; float: right;">
										<a class="btn green"
											href="${request.getContextPath()}/TrailPoolPojo/addTrailPool.do">
											<i class="fa fa-plus"></i> 新建线索
										</a>
										<button class="btn green" onclick="trailExport();">
											<i class="fa fa-file-excel-o"></i> 导出
										</button>
									</div>
								</div>
								<div class="table-scrollable">
									<table
										class="table table-striped table-bordered table-hover ttTbl"
										id="myTable">
										<thead>
											<tr>
												<th class="table-checkbox"><input type="checkbox"
													class="group-checkable" data-set="#myTable .checkboxes" />
												</th>
												<th scope="col">公司名</th>
												<th scope="col">来源</th scope="col">
												<th>行业</th>
												<th scope="col">职位</th>
												<th scope="col">联系人</th>
												<th scope="col">手机</th>
												<th scope="col">QQ</th>
												<th scope="col">下次联系时间</th>
												<th scope="col">下次联系内容</th>
												<th>负责人</th>
												<th scope="col">加入时间</th>
												<th scope="col">操作</th>
											</tr>
										</thead>
										<tbody>
											<#list tlist as TrailPoolPOJO>
											<tr class="odd gradeX">
												<td><input type="checkbox" class="checkboxes"
													name="checkboxes" value="${TrailPoolPOJO.id}" /></td>
												<td>${(TrailPoolPOJO.companyName)!}</td>
												<td>${TrailPoolPOJO.categorySourceName!}</td>
												<td>${TrailPoolPOJO.salesProducts!}</td>
												<td class="center">${TrailPoolPOJO.positions!}</td>
												<td class="center">${TrailPoolPOJO.contractName!}</td>
												<td class="center">${TrailPoolPOJO.mobilePhone!}</td>
												<td class="center"><#if TrailPoolPOJO.qqNum??>
													${TrailPoolPOJO.qqNum} <#else> </#if></td>
												<td class="center"><#if TrailPoolPOJO.nextTime??>
													${TrailPoolPOJO.nextTime!''} <#else> </#if></td>
												<td class="center tooltips" data-container="body"
													data-placement="bottom" data-html="true"
													data-original-title="
								<#if TrailPoolPOJO.nextContext??>${TrailPoolPOJO.nextContext}<#else></#if>">
													<#if TrailPoolPOJO.nextContext??>
													${TrailPoolPOJO.nextContext} <#else> </#if></td>
												<td class="center"><#if TrailPoolPOJO.userName??>
													${TrailPoolPOJO.userName} <#else> </#if></td>
												<td class="center"><#if TrailPoolPOJO.createdAt??>
													${TrailPoolPOJO.createdAt?string("yyyy-MM-dd HH:mm:ss")}
													<#else> </#if></td>
												<td><a class="btn btn-xs green"
													href="${request.getContextPath()}/TrailPoolPojo/selectTrailPool.do?id=${TrailPoolPOJO.id}">查看
												</a> <#if TrailPoolPOJO ?? && TrailPoolPOJO.status?? &&
													TrailPoolPOJO.status==0 > <a class="btn btn-xs green"
													href="${request.getContextPath()}/TrailPoolPojo/trailTocustomer.do?id=${TrailPoolPOJO.id}">转换
												</a> <a class="btn btn-xs green"
													href="${request.getContextPath()}/TrailPoolPojo/updateTrailPool.do?id=${TrailPoolPOJO.id}">修改
												</a> <#else> <a class="btn btn-xs grey" href="#" title="已转换">已转换
												</a> </#if></td>
											</tr>
											</#list>
										</tbody>
									</table>
								</div>
								<div style="width:80%;margin:0 auto;">
									<div id="kkpager"></div>
									<input type="hidden" value="${totalPage}" id="totalPage">
									<input type="hidden" value="${totalRecords}" id="totalRecords">
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- 内容结束 -->
	<!-- 底部开始 -->
	<#include "/include/foot.html" />
	<!-- 底部结束 -->

	<!--[if lt IE 9]>
<script src="${request.getContextPath()}/Public/assets/global/plugins/respond.min.js"></script>
<script src="${request.getContextPath()}/Public/assets/global/plugins/excanvas.min.js"></script> 
<![endif]-->
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-migrate.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-ui/jquery-ui.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap/js/bootstrap.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.blockui.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery.cokie.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/uniform/jquery.uniform.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/jquery-notific8/jquery.notific8.min.js"></script>

	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"
		type="text/javascript"></script>

	<script
		src="${request.getContextPath()}/Public/assets/global/scripts/metronic.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/layout.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/global/plugins/kkpager.min.js"
		type="text/javascript"></script>
	<script
		src="${request.getContextPath()}/Public/assets/admin/scripts/commonUtils.js"
		type="text/javascript"></script>
	<script type="text/javascript"
		src="${request.getContextPath()}/Public/My97DatePicker/WdatePicker.js"></script>
	<script>
		jQuery(document).ready(function() {
			Metronic.init(); // init metronic core componets
			Layout.init(); // init layout
			CommonUtils.checkInit();
			selectColumn();
		});

		//初始化分页插件
		function getParameter(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if (r != null)
				return unescape(r[2]);
			return null;
		}

		//init
		$(function() {
			var type = $("#typeVal").val();
			var tpoolOne = $("#tpoolOne").val();
			var tpoolTwo = $("#tpoolTwo").val();
			var tpoolThree = $("#tpoolThree").val();

			var totalPage = $('#totalPage').val();
			var totalRecords = $('#totalRecords').val();

			var pageNo = getParameter('pno');
			if (!pageNo) {
				pageNo = 1;
			}
			//生成分页
			//有些参数是可选的，比如lang，若不传有默认值
			kkpager.generPageHtml({
				pno : pageNo,
				//总页码
				total : totalPage,
				//总数据条数
				totalRecords : totalRecords,

				getLink : function(n) {
					return this.hrefFormer + this.hrefLatter + "?pno=" + n
							+ "&type=" + type + "&tpoolOne=" + tpoolOne
							+ "&tpoolTwo=" + tpoolTwo + "&tpoolThree="
							+ encodeURI(encodeURI(tpoolThree));
				}
			});
		});
		BASE_URL = '${request.getContextPath()}';
		function gettrollList(type) {
			if (type == "" || type == undefined || type == null) {
				type = $("#typeVal").val();
			}
			// 		alert(type);
			var url = BASE_URL + "/TrailPoolPojo/getAllList.do";
			var tpoolOne = $("#tpoolOne").val();
			var tpoolTwo = $("#tpoolTwo").val();
			var tpoolThree = $("#tpoolThree").val();
			url = url + "?type=" + type + "&tpoolOne=" + tpoolOne
					+ "&tpoolTwo=" + tpoolTwo + "&tpoolThree="
					+ encodeURI(encodeURI(tpoolThree));
			window.location = url;
		}

		function selectColumn() {
			var value = $("#tpoolOne").val();
			if (value == 9 || value == 12 || value == 13) {
				$('#tpoolThree').bind("click", function() {
					WdatePicker();
				});
			} else {
				$('#tpoolThree').unbind("click");
			}
		}

		function trailExport(type) {
			var checks = CommonUtils.getCheckedBoxs().join(",");

			if (type == "" || type == undefined || type == null) {
				type = $("#typeVal").val();
			}
			var url = BASE_URL + "/TrailPoolPojo/getAllList.do";
			var tpoolOne = $("#tpoolOne").val();
			var tpoolTwo = $("#tpoolTwo").val();
			var tpoolThree = $("#tpoolThree").val();
			urlParam ="?type=" + type + "&tpoolOne=" + tpoolOne
					+ "&tpoolTwo=" + tpoolTwo + "&tpoolThree="
					+ encodeURI(encodeURI(tpoolThree)) + "&ids=" + checks;

			window.location = "${request.getContextPath()}/TrailPoolPojo/trailExport.do"+urlParam;
		}
	</script>
</body>
</html>